package day05;
import java.util.Arrays;
public class zy0503 {
    public static void main(String[] args) {
        /*int[] arr1=new int[3];
        double[] arr2=new double[2];
        boolean[] arr3=new boolean[2];



        int[] arr4={1,2,3};
        double[] arr5=new double[]{1.1,1.2,1.3};
        boolean[] arr6;
        arr6=new boolean[]{true,false,true};






        int[] a=new int[3];
        a[0]=1;
        a[1]=2;
        a[2]=3;
        System.out.println(a[2]);
        System.out.println(a[a.length-1]);//最后一个元素
        System.out.println(a.length);//元素的数量


         */


        int[] b=new int[10];

        for (int i=0;i< b.length;i++){
            b[i]=(int)(Math.random()*100);
            System.out.println(b[i]);

        }
        int max=b[0];
        for (int i=0;i<b.length;i++){
            if (b[i]>max){
                max=b[i];
            }
        }


        System.out.println("最大值为"+max);













        /*
        int[]  arr1 =new int[3];//
        double[] arr2=new double[2];
        boolean[] arr3=new boolean[2];



        int[] arr4={1,2,3};
        double[] arr5=new double[]{1.1,2.2,3.3};
        boolean[] arr6;
        arr6=new boolean[]{true,false};


        int[] a =new int[3];
        a[0]=1;
        a[1]=3;
        a[2]=5;
        System.out.println(a[0]);//输出第一个元素
        System.out.println(a.length);//输出数组的长度
        System.out.println(a[a.length-1]);//输出最后一个元素




        int[]d=new int[10];
        for (int i=0;i< d.length;i++) {
            d[i] = (int) (Math.random() * 100);
            System.out.println(d[i]);
        }


            int max = d[0];
            for (int i= 0; i < d.length; i++) {
                if (d[i] > max) {
                    d[i] = max;
                }
            }
            System.out.println("最大值为" + max);

         */



    }

}
